package pl.koziolekweb.jqr.data;

public class StandardSerializer implements Serializer {

	private Separator separator;

	@Override
	public Separator getSeparator() {
		return separator;
	}

	@Override
	public String[] serialize(String text) {
		text = separator.removeAdditionalCharacters(text);
		String[] result = text.split(separator.getSeparatorString());
		for(int i =0 ; i< result.length; i++){
			result[i] = result[i].trim(); 
		}
		return result;
	}

	@Override
	public void setSeparator(Separator separator) {
		this.separator = separator;
	}

}
